Skip to content

Kotlin friendly names #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 18, 2021
Merged

Conversation

rnett
Copy link
Contributor

@rnett rnett commented May 15, 2021

Renames Shape.size to Shape.get and add a toListOrNull method. Was part of tensorflow/java#165.

Copy link
Collaborator

@Craigacp Craigacp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide some rational for why the method is renamed? Does kotlin treat get methods specially, or is there some conflict with size?

@rnett
Copy link
Contributor Author

rnett commented May 17, 2021

Yeah, Kotlin will automatically treat get as an operator, and rather than adding an extension in the Kotlin API Karl suggested I just change it here. Avoids overloading the meaning of size, too.

Copy link
Collaborator

@Craigacp Craigacp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm fine with this, but I'll let @karllessard merge it in case he has comments.

@rnett rnett requested a review from karllessard May 18, 2021 20:43
@karllessard karllessard merged commit d2aed4a into tensorflow:main May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants